#include <iostream>
#include <cstdio>
#include <list>

using namespace std;

list<int> List;

int main()
{
    int op, n, k;
    cin >> n;
    while (n--)
    {
        cin >> op;
        if (op == 1)
        {
            cin >> k;
            List.push_back(k);
        }
        else
        {
            int m = List.size();
            int i = 1;
            for (list<int>::iterator iter = List.begin(); iter != List.end(); iter++)
            {
                if (i % 2 == 0)
                {
                    iter = List.erase(iter);
                }
                i++;
            }
            for (list<int>::iterator iter = List.begin(); iter != List.end(); iter++)
            {
                cout << *iter << " ";
            }
        }
        //getchar();
    }
}